/**
 * 
 */
package com.zhiyou.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhiyou.mapper.VideoMapper;
import com.zhiyou.pojo.Video;
import com.zhiyou.pojo.VideoExample;
import com.zhiyou.pojo.VideoExample.Criteria;
import com.zhiyou.service.VideoService;

@Service
public class VideoServiceImpl implements VideoService{

	@Autowired
	private VideoMapper videoMapper;
	public List<Video> selectVideoByCourseId(int courseId) {
		VideoExample example=new VideoExample();
		Criteria createCriteria = example.createCriteria();
		createCriteria.andCourseIdEqualTo(courseId);
		return videoMapper.selectByExampleWithBLOBs(example);
	}
	
	public Video selectAll(int videoId) {
		
		return videoMapper.selectByPrimaryKey(videoId);
	}
	
	public void updatePlayNumById(Video video) {
	   videoMapper.updateByPrimaryKeySelective(video);
		
	}

}
